<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>我是一阵风直播</title>
    <link rel="stylesheet" type="text/css" href="../css/aui.css" />
    <style>
        #aui-header{position: fixed;}
    </style>
</head>
<body>
    <header class="aui-bar aui-bar-nav" id="aui-header">
        <a class="aui-pull-left aui-btn" tapmode onclick="goBack()">
            <span class="aui-iconfont aui-icon-left"></span>
        </a>
        <div class="aui-title">我的直播间</div>
    </header>

    <div class="aui-content aui-margin-b-15" id="my-video-main">
        <ul class="aui-list aui-media-list">

            <li class="aui-list-item aui-list-item-middle" onclick="stalive()" id="lives">
                <div class="aui-media-list-item-inner">
                    <div class="aui-list-item-media wechat-avatar">
                        <img src="../image/live.jpg" id="liveimg"/>
                    </div>
                    <div class="aui-list-item-inner">
                        <div class="aui-list-item-text">
                            <div class="aui-list-item-title" id="title">浅浅嫣然笑</div>
                            <div class="aui-list-item-right" id="creattime">1天前</div>
                        </div>
                        <div class="aui-list-item-text aui-font-size-12" id="username">
                            浅浅嫣然笑2020年2月25日11:39:38直播间
                        </div>
                    </div>
                </div>
            </li>

        </ul>
    </div>
</body>
<script type="text/javascript" src="../script/api.js" ></script>
<script type="text/javascript" src="../script/common.js" ></script>
<script type="text/javascript" src="../script/jquery.min.js"></script>
<script type="text/javascript">
apiready = function () {
    fixStatusBar();
    $api.css($api.byId('my-video-main'),'margin-top:'+headerHeight+'px;');

    api.parseTapmode();
    var name = $api.getStorage('true_name');
    var creattime = $api.getStorage('creattime');
    var live_cover = $api.getStorage('live_cover');
    console.log(live_cover);
    var newDate = new Date();
    newDate.setTime(creattime * 1000);
    var title = $api.getStorage('title');
    $api.text($api.byId('title'),title);
    $api.text($api.byId('creattime'),newDate.toLocaleDateString());
    $api.text($api.byId('username'),name);
    $api.attr($api.byId('liveimg'), "src", live_cover);
    if (title==undefined) {
      	$('#lives').hide();
    }else{
      	$('#lives').show();
    }

}
function stalive(){
  var rtmp_url = $api.getStorage('pushurl');
  var data = {
      rtmp_url:rtmp_url,
      resolution:720,
      direction:0
  };
  openFrm('video_push_frm',data);
}
</script>
</html>
